![]() ![]() |
IntroductionAs application sizes increase, more and more developers are hitting a little known limit in the Macintosh run-time architecture: the Segment Loader's limit on the number of jump table entries. The Segment Loader reads the jump table from Figure 1. Jump Table in 'CODE' Resource 0 Since the 68000 uses signed 16-bit offsets for This limit may seem rather small, but you have to remember that jump table entries are only needed if a function is called from outside of its own segment (a.k.a. an intersegment function call). For routines that are local to a segment (intrasegment function calls), the linker can call the routine without going through the jump table. If you are developing a large program, and you think you might be in danger of running out of jump table space, here are some guidelines you can use when designing and organizing your code:
The 4094 routine limit becomes a much more significant problem when you start working with MacApp and Object Pascal. If you compile your MacApp program with debugging turned on, you will get a jump table entry for every method in your program. All of a sudden, an application of medium size can have jump table problems. Working around this problem is extremely difficult, since the only options available to you are:
Both of these options are extremely distasteful, but the final version of MacApp 2.0 will alleviate the problem by letting you compile your programs with both debugging and optimization turned on. The optimizer will drastically reduce the number of jump table entries, so the problem should only occur with very large programs. Downloadables
|
Developer Documentation | Technical Q&As | Development Kits | Sample Code |